package com.supermap.business.cloud.assets.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.assets.order.Order;
import com.supermap.dubbo.api.cloud.assets.order.OrderComm;
import com.supermap.dubbo.api.cloud.assets.order.OrderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author aqua
 * @description 订单管理
 * @date 2019年10月18 14:47
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/assets/order")
public class OrderController {
    @Reference(timeout = 10000)
    OrderService orderService;

    @GetMapping("/getOrderPageList")
    @ResponseBody
    public JSONUtils getApiMenuList(String userName,String title ,Integer state,String bdate,String edate,Integer page,Integer size){
        return  orderService.getOrderPageList( userName, title , state,bdate,edate, page, size);
    }


    @PostMapping("/manageAudit")
    @ResponseBody
    public JSONUtils manageAudit(Integer orderId,String scontent,String suserId,Integer state){
        return  orderService.manageAudit(orderId,scontent,suserId,state);
    }
    @PutMapping("/putOrder")
    @ResponseBody
    public JSONUtils putOrder(@RequestBody Order order){
        return  orderService.putOrder(order);
    }


    @PostMapping("/postOrder")
    @ResponseBody
    public JSONUtils postOrder(@RequestBody OrderComm orderComm){
        return  orderService.postOrder(orderComm);
    };
    @DeleteMapping("/delOrder")
    @ResponseBody
    public JSONUtils delOrder( Integer id){
        return  orderService.delOrder(id);
    };

}
